<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:set var="ctx" value="${pageContext.request.contextPath}" />
<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="utf-8" />
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
	<title>合同管理系统</title>
	<link rel="icon" href="/plugins/kadmin/images/title.ico" type="image/x-icon" />
	<link rel="stylesheet" href="/plugins/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="/plugins/font-awesome/css/font-awesome.min.css" media="all" />
	<link rel="stylesheet" href="/plugins/kadmin/css/app.css" media="all" />
	<link rel="stylesheet" href="/css/themes/blue.css" media="all">
	<script src="/plugins/layui/layui.js"></script>
	<script src="/js/app.js"></script>
</head>
<body class="kit-theme">
	<div class="layui-layout layui-layout-admin kit-layout-admin">
		<div class="layui-header">
			<div class="layui-logo">合同管理系统</div>
			  <ul class="layui-nav layui-layout-right kit-nav">
                <li class="layui-nav-item">
                    <a href="javascript:;">
						<img src="/img/logo.png" class="layui-nav-img"> ${loginUser.userName}
                    </a>
                    <dl class="layui-nav-child">
                        <dd>
							<a href="javascript:;" kit-target data-options="{url:'/sysUser/vw_information?pkId=${loginUser.pkId}',title:'基本资料',id:'null'}"><i class="fa fa-user" aria-hidden="true"></i><span>基本资料</span></a>
                        </dd>
                    </dl>
                </li>
                <li class="layui-nav-item"><a href="javascript:;" id="logout" onclick="logout();"><i class="fa fa-sign-out" aria-hidden="true"></i> 注销</a></li>
            </ul>
		</div>
		<div class="layui-side layui-bg-black kit-side">
			<div class="layui-side-scroll">
				<div class="kit-side-fold">
					<i class="fa fa-navicon" aria-hidden="true"></i>
				</div>
				<!-- 左侧导航区域（可配合layui已有的垂直导航） -->
				<ul class="layui-nav layui-nav-tree" lay-filter="kitNavbar" kit-navbar>
					<c:forEach items="${menus}" var="firTree">
						<c:if test="${firTree.hasChild == '0' && firTree.parentId == ''}">
							<li class="layui-nav-item">
								<a kit-target
								   data-options="{url:'${firTree.url}',icon:'${firTree.ico}',title:'${firTree.contractName}',id:'${firTree.pkId}'}">
									<i class="layui-icon">${firTree.ico}</i><span>${firTree.contractName}</span>
								</a>
							</li>
						</c:if>
						<c:if test="${firTree.hasChild == '1'}">
							<li class="layui-nav-item">
								<a class="" href="javascript:;"><span>${firTree.contractName}</span></a>
								<dl class="layui-nav-child">
									<c:forEach items="${menus}" var="secTree">
										<c:if test="${firTree.pkId==secTree.parentId && secTree.state == '1'}">
											<dd>
												<a href="javascript:;" kit-target
												   data-options="{url:'${secTree.url}',icon:'${secTree.ico}',title:'${secTree.contractName}',id:'${secTree.pkId}'}">
													<i class="layui-icon">${secTree.ico}</i><span>${secTree.contractName}</span>
												</a>
											</dd>
										</c:if>
									</c:forEach>
								</dl>
							</li>
						</c:if>

					</c:forEach>
				</ul>
			</div>
		</div>
		<div class="layui-body" id="container">
		</div>
		<div class="layui-footer" style="text-align:center;">Copyright ©2018-2021 lucky 版权所有</div>
	</div>
	<script>
		var message;
		layui.config({
			base : '/plugins/kadmin/js/'
		}).use(['app', 'message'], function() {
			var app = layui.app, $ = layui.jquery, layer = layui.layer;
			//将message设置为全局以便子页面调用
			message = layui.message;
			//主入口
			app.set({
				type : 'iframe'
			}).init();
		});

		function logout() {
			layer.confirm('确定注销当前用户?', function(index){
				ajaxExec('${ctx}/login/logout.do', null, function(){
					layer.msg('注销用户成功！', {icon: 6, time: 2000});
					location.href = '${ctx}/main/web';
				}, function(retInfo){
					layer.msg('注销用户失败，' + retInfo.msg, {icon: 5, time: 2000});
				});
			    layer.close(index);
			});
		}
	</script>
</body>
</html>